/*
 Copyright 2018-present Sonatype, Inc.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
@import '../../../styles';

@mixin avatar-img($url) {
  background-image: url('/assets/images/' + $url);
}

.mat-smo-dependency-information-card {

  @include smo-lt-md() {
    padding: 0.5rem;
  }

  .mat-card-content {
    overflow-x: hidden;
    padding: 0 15px;

    @include smo-lt-md() {
      padding: 0;
    }

    &.snippet {
      //turn off flex, currently solely used for the dependency snippets, as flex isn't necessary
      //and the column flex layout of the single item is hosing IE up
      flex: 0 1 auto;

      @include deep {
        .mat-form-field-wrapper {
          //dump the padding, since it will now be used in the text area below
          padding-bottom: 0em;
        }
      }

      //add padding that was removed from the above .mat-form-field-wrapper
      //this will give more space for the scrollbar
      textarea {
        padding-bottom: 15px;
      }
    }

    .template-value {

      @include deep {
        .mat-form-field-wrapper {
          margin: 0 15px;
        }
      }

      overflow: hidden;
      background-color: whitesmoke;

      font-family: "Courier New", Courier, monospace;
      line-height: 1.3;

      textarea {
        overflow-x: auto;
        overflow-y: hidden;
        resize: none;
        white-space: pre;
        min-height: 30px;
      }
    }
  }

  .mat-card-avatar {
    background-size: cover;
    border: 1px solid $smo-border-color;

    &.img-badge {
      @include avatar-img('badge.svg');
      background-position-x: left;
    }

    &.img-mvn {
      @include avatar-img('mvn.png');
    }

    &.img-buildr {
      @include avatar-img('buildr.png');
    }

    &.img-ivy {
      @include avatar-img('ivy.png');
    }

    &.img-groovy {
      @include avatar-img('groovy.png');
    }

    &.img-grails {
      @include avatar-img('grails.png');
    }

    &.img-gradle {
      @include avatar-img('gradle.png');
      background-position-x: -13px;
      background-position-y: -1px;
    }

    &.img-kotlin {
      @include avatar-img('kotlin.png');
    }

    &.img-bazel {
      @include avatar-img('bazel.png');
      background-position-x: center;
    }

    &.img-purl {
      @include avatar-img('purl.png');
    }

    &.img-scala {
      @include avatar-img('sbt.svg');
      background-position-x: center;
    }

    &.img-leiningen {
      @include avatar-img('leiningen.jpg');
    }

    &.img-xml {
      @include avatar-img('xml.svg');
      background-position-x: center;
    }
  }
}
